import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FeeDisclosureVO, FeeDisclosureForm, FeeDisclosureQuery } from '@/api/cemetery/feeDisclosure/types';

/**
 * 查询收费公示列表
 * @param query
 * @returns {*}
 */

export const listFeeDisclosure = (query?: FeeDisclosureQuery): AxiosPromise<FeeDisclosureVO[]> => {
  return request({
    url: '/cemetery/feeDisclosure/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收费公示详细
 * @param id
 */
export const getFeeDisclosure = (id: string | number): AxiosPromise<FeeDisclosureVO> => {
  return request({
    url: '/cemetery/feeDisclosure/' + id,
    method: 'get'
  });
};

/**
 * 新增收费公示
 * @param data
 */
export const addFeeDisclosure = (data: FeeDisclosureForm) => {
  return request({
    url: '/cemetery/feeDisclosure',
    method: 'post',
    data: data
  });
};

/**
 * 修改收费公示
 * @param data
 */
export const updateFeeDisclosure = (data: FeeDisclosureForm) => {
  return request({
    url: '/cemetery/feeDisclosure',
    method: 'put',
    data: data
  });
};

/**
 * 删除收费公示
 * @param id
 */
export const delFeeDisclosure = (id: string | number | Array<string | number>) => {
  return request({
    url: '/cemetery/feeDisclosure/' + id,
    method: 'delete'
  });
};
